package com.llxz.blog.article.controller;

import com.llxz.blog.article.service.LabelService;
import com.llxz.blog.article.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "article")
public class LabelController {

    @Autowired
    private LabelService labelService;

    @PostMapping("/label/popular")
    public JsonResult getPopular() {
        List<String> list =  labelService.getPopularLabels();
        return new JsonResult(list);
    }
}

